import java.util.Comparator;
import java.util.Random;
import java.util.Set;
import java.util.TreeSet;

public class Test6 {
    public static void main(String[] args) {
        Random r = new Random();
        Set<Integer> set = new TreeSet<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o1-o2;
            }
        });
        for (;;) {
            set.add(r.nextInt(51));
            if (set.size()==10){
                break;
            }
        }
        System.out.println(set);
        Set<Integer> set2 = new TreeSet<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2-o1;
            }
        });
        for (;;) {
            set2.add(r.nextInt(51)+50);
            if (set2.size()==10){
                break;
            }
        }
        System.out.println(set2);

    }
}
